package com.smartleanx.module.hrm.service.esign.eums;

import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.smartleanx.module.bpm.api.v2.dto.UserInfo;
import com.smartleanx.module.hrm.dal.dataobject.employee.EmployeeDO;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 任务状态枚举
 *
 * @author xzq
 * @since 2025/7/14
 */
@Getter
@RequiredArgsConstructor
public enum CustomComponentsEnum {

    EMP_NAME("1", "员工姓名"),
    EMP_PHONE("2", "员工手机号"),
    EMP_CORP("3", "主体公司"),
    EMP_AGE("4", "年龄"),
    EMP_CARD_ID("5", "身份证号码"),
    EMP_SEX("6", "性别"),
    EMP_ADDRESS("7", "户籍地址"),
    EMP_NO("8", "员工工号"),
    EMP_DEP("9", "员工部门"),
    EMP_POST("10", "员工岗位"),

    ;

    private final String code;
    private final String desc;

    public String getComponentsValue(String code,Object object){
        if(CustomComponentsEnum.EMP_NAME.code.equals(code)){
            EmployeeDO employeeDO = (EmployeeDO) object;
            return employeeDO.getName();
        }
        if(CustomComponentsEnum.EMP_PHONE.code.equals(code)){
            EmployeeDO employeeDO = (EmployeeDO) object;
            return employeeDO.getMobile();
        }
        if(CustomComponentsEnum.EMP_CORP.code.equals(code)){
            EmployeeDO employeeDO = (EmployeeDO) object;
            return employeeDO.getMobile();
        }
        return null;
    }
}
